package ganggaroo.kbs.web;

import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;


import ganggaroo.kbs.service.TwitDefaultVO;
import ganggaroo.kbs.service.TwitInfoVO;
import ganggaroo.kbs.service.TwitService;


/**  
 * @Class Name : TwitController.java
 * @Description : 트윗 콘트롤러
 * @Modification Information  
 * @
 * @  수정일      수정자              수정내용
 * @ ---------   ---------   -------------------------------
 * @ 2011.04.05  강영석         최초생성
 * 
 * @author 강영석
 * @since 2011.04.05 
 * @version 1.0
 * @see
 * 
 */

@Controller
@SessionAttributes(types=TwitInfoVO.class)
public class TwitController {

	/** TwitService */
    @Resource(name = "twitService")
    private TwitService twitService;
    
    protected Log log = LogFactory.getLog(this.getClass());
    
    /**
	 * 트윗 내용 조회한다.
	 * @param searchVO - 조회할 정보가 담긴 TwitDefaultVO
	 * @param model
	 * @return "/twit/twitList"
	 * @exception Exception
	 */
    @RequestMapping(value="/twit/twitList.do")
    public String selectTwitList(@ModelAttribute("searchVO") TwitDefaultVO searchVO, 
    		ModelMap model)throws Exception {
    	
    	List<TwitInfoVO> tweetList = twitService.selectTwitList(searchVO);
    	model.addAttribute("twitList", tweetList);
    	
        return null;
    }
}
